<template>
    <div>
        <NuxtLogo/>
        <HelloWorld/>
        <p>asyncData的数据会直接合并到vue的data中 </p>
        <h1>{{name}}</h1>
    </div>
   
</template>

<script>
import HelloWorld from '../../components/hello-world/HelloWorld.vue'
import NuxtLogo from '../../components/NuxtLogo.vue';
export default {
    name: "HelloWorld",
    layout: 'test', //默认的使用default.vue
    //只有在pages目录下的VUE代码才可以使用asyncData，fetch，head三个方法
    asyncData(context) {
        // called every time before loading the component
        return { name: "The data From asyncData()" };
    },
    fetch() {
        // The fetch method is used to fill the store before rendering the page
    },
    head() {
        // Set Meta Tags for this Page
    },
    components: { HelloWorld, NuxtLogo },
    data(){},
    computed:{},
    mounted() {},
    methods: {},                                                                                                                                                                                                                                                                                                                                    
}
</script>
